/*
 Navicat Premium Data Transfer

 Source Server         : docker-mssql
 Source Server Type    : SQL Server
 Source Server Version : 15004123
 Source Host           : localhost:1433
 Source Catalog        : XDB
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 15004123
 File Encoding         : 65001

 Date: 17/06/2021 21:46:52
*/


-- ----------------------------
-- Table structure for ba_department
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ba_department]') AND type IN ('U'))
	DROP TABLE [dbo].[ba_department]
GO

CREATE TABLE [dbo].[ba_department] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [name] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [code] varchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL,
  [create_man] int DEFAULT '' NOT NULL,
  [modify_man] int DEFAULT '' NULL,
  [create_time] char(19) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [modify_time] char(19) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [delete_flag] bit DEFAULT 0 NOT NULL,
  [order_no] int DEFAULT 999 NOT NULL
)
GO

ALTER TABLE [dbo].[ba_department] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of ba_department
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[ba_department] ON
GO

SET IDENTITY_INSERT [dbo].[ba_department] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for ba_user
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ba_user]') AND type IN ('U'))
	DROP TABLE [dbo].[ba_user]
GO

CREATE TABLE [dbo].[ba_user] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [code] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [name] nvarchar(14) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [password] char(32) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [mobile_phone] varchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [head_image] char(32) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [sex] int  NULL,
  [email] varchar(320) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [ip] nvarchar(60) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [last_login_time] char(28) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [last_login_environment] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [create_man] int DEFAULT 0 NULL,
  [modify_man] int  NULL,
  [create_time] char(28) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT CONVERT([char](19),getdate(),(120)) NULL,
  [modify_time] char(28) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [delete_flag] bit DEFAULT 0 NULL,
  [role_id] int DEFAULT 0 NULL
)
GO

ALTER TABLE [dbo].[ba_user] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'登录名',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'用户姓名',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'password'
GO

EXEC sp_addextendedproperty
'MS_Description', N'手机号',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'mobile_phone'
GO

EXEC sp_addextendedproperty
'MS_Description', N'头像',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'head_image'
GO

EXEC sp_addextendedproperty
'MS_Description', N'性别  1男 0女',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'sex'
GO

EXEC sp_addextendedproperty
'MS_Description', N'EMAIL',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'email'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最后登录IP',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'ip'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最后登陆时间',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'last_login_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最后登录客户端环境',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'last_login_environment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'create_man'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'modify_man'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'create_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'modify_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否删除',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'delete_flag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'角色',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'COLUMN', N'role_id'
GO


-- ----------------------------
-- Records of ba_user
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[ba_user] ON
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'1', N'admin', N'超小管', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'admin@163.com', N'127.0.0.1-XCPFrame.Application.Api.stLocation', N'06/17/2021 20:35:55         ', N'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15', N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'1')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'2', N'user2', N'user2', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user2@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'3', N'user3', N'user3', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user3@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'4', N'user4', N'user4', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user4@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'5', N'user5', N'user5', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'0', N'user5@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'6', N'user6', N'user6', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user6@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'7', N'user7', N'user7', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user7@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'8', N'user8', N'user8', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user8@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'9', N'user9', N'user9', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user9@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'10', N'user11', N'user11', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user11@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'11', N'user12', N'user12', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'.png                            ', N'1', N'user12@163.com', NULL, N'2021-06-11 06:46:50         ', NULL, N'1', NULL, N'2021-06-11 06:47:08         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'12', N'edit', N'我被编辑了', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', N'                                ', N'0', N'a@a.com', NULL, NULL, N'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15', NULL, N'1', NULL, N'06/17/2021 10:38:58         ', NULL, N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'13', N'233', N'22', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', NULL, NULL, NULL, NULL, NULL, NULL, N'0', NULL, N'2021-06-11 14:22:06         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'14', N'adf', N'发发达发', N'4509bbf92c69aed2e86ab33b49dadec6', N'13839393234', NULL, NULL, NULL, NULL, NULL, NULL, N'0', NULL, N'2021-06-12 23:49:41         ', NULL, N'0', N'2')
GO

INSERT INTO [dbo].[ba_user] ([id], [code], [name], [password], [mobile_phone], [head_image], [sex], [email], [ip], [last_login_time], [last_login_environment], [create_man], [modify_man], [create_time], [modify_time], [delete_flag], [role_id]) VALUES (N'15', N'guest', N'用户名', N'4509bbf92c69aed2e86ab33b49dadec6', N'18283838383', N'                                ', N'1', N'db@3.com', NULL, NULL, N'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15', N'1', N'1', N'06/17/2021 10:28:13         ', N'                            ', NULL, N'3')
GO

SET IDENTITY_INSERT [dbo].[ba_user] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_config]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_config]
GO

CREATE TABLE [dbo].[sys_config] (
  [key] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [value] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [order_no] int  NOT NULL,
  [type] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[sys_config] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_config
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_department_user
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_department_user]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_department_user]
GO

CREATE TABLE [dbo].[sys_department_user] (
  [department_id] int  NOT NULL,
  [user_id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[sys_department_user] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_department_user
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_node
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_node]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_node]
GO

CREATE TABLE [dbo].[sys_node] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [title] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [name] varchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL,
  [icon] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [jump] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [spread] bit DEFAULT 0 NULL,
  [pid] int  NOT NULL,
  [order_no] int  NOT NULL,
  [path] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [level] int  NOT NULL
)
GO

ALTER TABLE [dbo].[sys_node] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'前端默认路由名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_node',
'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'父级ID',
'SCHEMA', N'dbo',
'TABLE', N'sys_node',
'COLUMN', N'pid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'如：1-1-1 ， 代表各级id关系',
'SCHEMA', N'dbo',
'TABLE', N'sys_node',
'COLUMN', N'path'
GO

EXEC sp_addextendedproperty
'MS_Description', N'层级数',
'SCHEMA', N'dbo',
'TABLE', N'sys_node',
'COLUMN', N'level'
GO


-- ----------------------------
-- Records of sys_node
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[sys_node] ON
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'4', N'用户管理', N'user', N'layui-icon-component', NULL, N'0', N'0', N'999', N'4-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'5', N'用户列表', N'list', N'layui-icon-component', N'/xuser/list/', N'0', N'4', N'999', N'4-5-', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'6', N'部门管理', N'dept', N'layui-icon-component', NULL, N'0', N'0', N'999', N'6-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'8', N'目录管理', N'menu', N'layui-icon-component', NULL, N'0', N'0', N'999', N'8-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'9', N'目录维护', N'index', N'layui-icon-component', NULL, N'0', N'8', N'999', N'8-9-', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'15', N'temp2', N'temp2', N'layui-icon-component', NULL, N'0', N'19', N'999', N'6-11-15-', N'3')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'16', N'部门列表', N'index', N'layui-icon-component', NULL, N'0', N'6', N'999', N'6-16-', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'17', N'系统管理', N'system', N'layui-icon-component', NULL, N'0', N'0', N'999', N'17-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'18', N'目录维护', N'menu', N'layui-icon-component', NULL, N'0', N'17', N'999', N'17-18-', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'19', N'temp1', N'temp', N'layui-icon-component', N'/xcode/role-node/', N'0', N'6', N'999', N'6-19-', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'20', N'temp3', N'temp3', N'layui-icon-component', NULL, N'0', N'19', N'999', N'6-11-20', N'3')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'21', N'业务管理', N'business', N'layui-icon-component', N'', N'0', N'0', N'999', N'd', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'22', N'报表管理', N'reports', N'layui-icon-component', N'', N'0', N'0', N'999', N'0-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'23', N'root', N'root', N'layui-icon-component', N'', N'0', N'0', N'999', N'0', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'27', N'r2', N'?', N'layui-icon-component', N'', N'0', N'0', N'999', N'2', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'28', N'角色管理', N'role', N'layui-icon-component', N'', N'0', N'0', N'999', N'0-', N'1')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'33', N'角色列表', N'list', N'layui-icon-component', N'/xrole/list/', N'0', N'28', N'999', N'0', N'2')
GO

INSERT INTO [dbo].[sys_node] ([id], [title], [name], [icon], [jump], [spread], [pid], [order_no], [path], [level]) VALUES (N'34', N'角色权限设置', N'role-node', N'layui-icon-component', N'/xrole/role-node/', N'0', N'28', N'999', N'0', N'2')
GO

SET IDENTITY_INSERT [dbo].[sys_node] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_role]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_role]
GO

CREATE TABLE [dbo].[sys_role] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [name] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [delete_flag] bit DEFAULT 0 NOT NULL,
  [order_no] int DEFAULT 999 NOT NULL
)
GO

ALTER TABLE [dbo].[sys_role] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[sys_role] ON
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'1', N'超管', N'0', N'999')
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'2', N'访客', N'0', N'999')
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'3', N'平台管理员', N'0', N'999')
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'4', N'新角色名称', N'1', N'999')
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'5', N'新2', N'1', N'999')
GO

INSERT INTO [dbo].[sys_role] ([id], [name], [delete_flag], [order_no]) VALUES (N'6', N'新角色名称', N'1', N'999')
GO

SET IDENTITY_INSERT [dbo].[sys_role] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_role_node
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_role_node]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_role_node]
GO

CREATE TABLE [dbo].[sys_role_node] (
  [role_id] int  NOT NULL,
  [node_id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[sys_role_node] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_role_node
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'4')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'5')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'6')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'8')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'9')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'15')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'16')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'17')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'18')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'19')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'20')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'21')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'22')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'23')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'27')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'28')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'33')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'1', N'34')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'2', N'17')
GO

INSERT INTO [dbo].[sys_role_node] VALUES (N'2', N'18')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_user_role]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_user_role]
GO

CREATE TABLE [dbo].[sys_user_role] (
  [user_id] int  NOT NULL,
  [role_id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[sys_user_role] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for sys_version
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_version]') AND type IN ('U'))
	DROP TABLE [dbo].[sys_version]
GO

CREATE TABLE [dbo].[sys_version] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [app_name] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [platform] nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [version_code] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
  [verstion_name] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL,
  [remarks] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL
)
GO

ALTER TABLE [dbo].[sys_version] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of sys_version
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[sys_version] ON
GO

SET IDENTITY_INSERT [dbo].[sys_version] OFF
GO

COMMIT
GO


-- ----------------------------
-- Auto increment value for ba_department
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[ba_department]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table ba_department
-- ----------------------------
ALTER TABLE [dbo].[ba_department] ADD CONSTRAINT [PK__ba_depar__3213E83F760E5F78] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for ba_user
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[ba_user]', RESEED, 16)
GO


-- ----------------------------
-- Uniques structure for table ba_user
-- ----------------------------
ALTER TABLE [dbo].[ba_user] ADD CONSTRAINT [uniques-key-code] UNIQUE NONCLUSTERED ([code] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

EXEC sp_addextendedproperty
'MS_Description', N'登录名唯一',
'SCHEMA', N'dbo',
'TABLE', N'ba_user',
'CONSTRAINT', N'uniques-key-code'
GO


-- ----------------------------
-- Primary Key structure for table ba_user
-- ----------------------------
ALTER TABLE [dbo].[ba_user] ADD CONSTRAINT [PK__test__3213E83F5B60B081] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table sys_config
-- ----------------------------
ALTER TABLE [dbo].[sys_config] ADD CONSTRAINT [PK__sys_conf__7BD3820D768D36F2] PRIMARY KEY CLUSTERED ([key], [type])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table sys_department_user
-- ----------------------------
ALTER TABLE [dbo].[sys_department_user] ADD CONSTRAINT [PK__sys_depa__29B8C752102DE779] PRIMARY KEY CLUSTERED ([department_id], [user_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for sys_node
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_node]', RESEED, 34)
GO


-- ----------------------------
-- Primary Key structure for table sys_node
-- ----------------------------
ALTER TABLE [dbo].[sys_node] ADD CONSTRAINT [PK__sys_node__3213E83FFA47251C] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for sys_role
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_role]', RESEED, 6)
GO


-- ----------------------------
-- Primary Key structure for table sys_role
-- ----------------------------
ALTER TABLE [dbo].[sys_role] ADD CONSTRAINT [PK__sys_role__3213E83F9DDB598E] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table sys_role_node
-- ----------------------------
ALTER TABLE [dbo].[sys_role_node] ADD CONSTRAINT [PK__sys_role__03F8FB3DA6472175] PRIMARY KEY CLUSTERED ([role_id], [node_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table sys_user_role
-- ----------------------------
ALTER TABLE [dbo].[sys_user_role] ADD CONSTRAINT [PK__sys_user__6EDEA1533F9B36FC] PRIMARY KEY CLUSTERED ([user_id], [role_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for sys_version
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_version]', RESEED, 2)
GO


-- ----------------------------
-- Primary Key structure for table sys_version
-- ----------------------------
ALTER TABLE [dbo].[sys_version] ADD CONSTRAINT [PK__sys_vers__3213E83FBE32FBF9] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

